
<HTML>
 <HEAD>
  <TITLE> API document </TITLE>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" href="../css/zTreeStyle/zTreeStyle.css" type="text/css">
  <style>
	body {
	background-color: white;
	margin:0; padding:0;
	text-align: center;
	}
	div, p, table, th, td {
		list-style:none;
		margin:0; padding:0;
		color:#333; font-size:12px;
		font-family:dotum, Verdana, Arial, Helvetica, AppleGothic, sans-serif;
	}
	.ztree li a.curSelectedNode {
		padding-top: 0px;
		background-color: #FFE6B0;
		color: black;
		height: 16px;
		border: 1px #FFB951 solid;
		opacity: 0.8;
	}
  </style>
<script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="../src/ztree_toc.js"></script>
	<SCRIPT type="text/javascript" >
	<!--
	$(document).ready(function(){
		$('#tree').ztree_toc({
			is_auto_number: true,
			// documment_selector: '.first_part'
		});
	});
	//-->
	</SCRIPT>

 </HEAD>

<BODY>
<TABLE border=0 height=600px align=left>
	<TR>
		<TD width=260px align=left valign=top style="BORDER-RIGHT: #999999 1px dashed">
			<ul id="tree" class="ztree">
				
			</ul>
		</TD>
		<TD width=770px align=left valign=top>

<h1>说明</h1>

<div style='margin-bottom:20px;'>
	<pre style='background:#C7EDCC;font-size:18px'>
	<strong>返回说明：</strong>

		status:1-返回正常 0-出现未知错误 -1-出现异常(已知错误)
		msg:当status为0时出现，内容是错误的编码，前端直接中断用户操作，在页面打印错误编码
		expand：数组形式，存在info、type,total等拓展字段。
				info 在status为-1时出现，是异常信息，前端可显示给用户看，
				type是异常信息的类型，没有登录或字段错误等，total一般是总条数
		data:返回的数据
		
		例如：
		{
			"status":1,  //实名成功
			"data":null
		}
		{
			"status":-1,  //-1时有异常
			"expand":{
					"info":"请先登录",
					"type":1  //1-用户没有登录 2-没有输入真实姓名 3-没有输入身份证号 
					            4-没有正面照 5-没有背面照  6-没有同意协议 7-认证失败
					},
			"data":null
		}
		{
			"status":0,  //0时有错误
			"msg":"错误码a15"
		}

		如果status非以上3种，前端可报网络错误
	</pre>
</div>

<h1>云名片0.1.1(接口域名为测试版的)</h1>

<h2>记录openId和名片id</h2>

<div style='margin-bottom:20px;'>
	<pre style='background:#C7EDCC;font-size:12px'>
	<!-- <h3>是否登录</h3> -->
	<strong>调用请求：</strong>http://tcard.6vbuy.com/card.php?s=User/OpenIdRecord
	<strong>传递参数：</strong>
			{
				"phpsid":'ffffffffff',//session_id
				"openId":'ffffffffff',//openId
			}
		
	<strong>返回值：</strong>

		{
			"status":1,//记录成功状态
			"data":null
		}
		{
			"status":-1,
			"expand":{"info":"名片不存在"},
			"data":null
		}

		如果status非以上2种，前端可报网络错误

	</pre>
</div>


<h2>公共接口：是否是游客</h2>

<div style='margin-bottom:20px;'>
	<pre style='background:#C7EDCC;font-size:12px'>
	<!-- <h3>点击暂不注册</h3> -->
	<strong>调用请求：</strong>http://tcard.6vbuy.com/card.php?s=User/is_Tourist
	<strong>传递参数：</strong>
			{
				"phpsid":'ffffffffff',//session_id
			}
		
	<strong>返回值：</strong>

		{
			"status":1,//成功状态
			"data":3 //1-正式用户 2-游客 3-未登录
		}

		{
			"status":0,  //0时有错误
			"msg":"错误码a15"
		}

		如果status非以上2种，前端可报网络错误

	</pre>
</div>

<h2>游客登录</h2>

<div style='margin-bottom:20px;'>
	<pre style='background:#C7EDCC;font-size:12px'>
	<h3>点击暂不注册</h3>
	<strong>调用请求：</strong>http://tcard.6vbuy.com/card.php?s=User/TouristLogin
	<strong>传递参数：</strong>
			{
				"openId":'ffffffffff',//openId
				"name":'ffffffffff',//微信昵称,可以为空
		
	<strong>返回值：</strong>

		{
			"status":1,//登录成功状态
			"data":"rnk59damsne1qomicmuai31d62" //返回session_id
		}
		{
			"status":-1, 
			"expand":{"info":"参数错误"},//前端没有传输openId
			"data":null
		}

		{
			"status":0,  //0时有错误
			"msg":"错误码a15"
		}

		如果status非以上3种，前端可报网络错误

	</pre>
</div>

<h2>选择制作页</h2>

<div style='margin-bottom:20px;'>
	<pre style='background:#C7EDCC;font-size:12px'>
	<h3>获取名片图链接</h3>
	<strong>调用请求：</strong>http://tcard.6vbuy.com/card.php?s=Show/ChooseCCardPictrue/id/10 //10是名片id，前端要动态传输

	</pre>
</div>

<h2>贺卡详情页(分享出去的)</h2>

<div style='margin-bottom:20px;'>
	<pre style='background:#C7EDCC;font-size:12px'>
	<h3>获取名字</h3>
	<strong>调用请求：</strong>http://tcard.6vbuy.com/card.php?s=BlessCard/shareCardInit

	<strong>传递参数：</strong>
			{
				"phpsid":'ffffffffff',//session_id
			}
		
	<strong>返回值：</strong>

		{
		"status":1,
		"expand":{"is_pic":3,"is_oneself":1},
		"data":{
		"btitle":"h",
		"name":"____",//姓名(用于来自谁谁谁的祝福)
		"img":{
		"id":"219",
		"path":"http:\/\/www.ttc.com\/Uploads\/Picture\/2018-02-07\/5a7a58030ebb8.png"},
		"backgimg":
		{"id":"14","path":"http:\/\/www.ttc.com\/Uploads\/Picture\/2018-02-07\/5a7a58030ebb8.png"},
		"Ctemplimg":
		{"id":"17","path":"http:\/\/www.ttc.com\/Uploads\/Picture\/2018-02-07\/5a7a58030ebb8.png"},
		"content":"",
		"Wtemplimg":{"id":"","path":""},"Qcode_path":"http:\/\/card.6vbuy.com\/card.php?s=Public\/ChooseMakeqrurl\/7"
		}
		}

		{
			"status":0,  //0时有错误
			"msg":"错误码a15"
		}

		如果status非以上2种，前端可报网络错误

	</pre>

	</pre>
</div>

<h2>修改云名片登录接口</h2>

<div style='margin-bottom:20px;'>
	<pre style='background:#C7EDCC;font-size:12px'>
	<h3>提交注册/登录信息</h3>
	<strong>调用请求：</strong>http://www.ttc.com/card.php?s=User/login
	<strong>传递参数：</strong>
			{
				"mobile":'18826875567', //手机号
				"verify":'6433', //文字验证码
				"name":'周斯航', //姓名 (登录也可以传输这个参数过来，传输的值为空)
				"msm_verify":'1885'  //短信验证码
				"phpsid":'ewjksklakla'  //session_id 当前验证码的session_id
				"openId":'ewjksklakla'  //openId
			}
		
	<strong>返回值：</strong>

		{
			"status":1, //成功状态
			"expand":{"info":'注册成功'}
			"data":"r3gkrukc7ttcbnheei97o81bc7" //返回session_id
		}
		{
			"status":-1, //有异常
			"expand":{
						"info":"验证码输入错误！",
						"type":1  //1-文字验证码出错 2-手机出错 3-短信验证码出错 4-姓名出错
					 },
			"data":null
		}
		{
			"status":0,  //0时有错误
			"msg":"错误码a15"
		}

		如果status非以上3种，前端可报网络错误

	</pre>
</div>
			 
		</TD>
	</TR>
</TABLE>

</BODY>
</HTML>
